<?php	
	
include ("./src/jpgraph.php");
include ("./src/jpgraph_line.php");
$graph = new Graph(900,550,"auto");
$graph->SetScale("textlin");

$graph->img->SetMargin(50,30,20,120);    
$graph->SetShadow();

$datax=array("V","Tomm","Atda","Boto","Tojo","mCm","Dres","Fran","Trep","Trem","Aren","Llvi","Llde","Cara","Ashg","Ldov","Wenl","Ludl","Prid","Gedi","Sieg","Emsi","Eife","Give","Fras","Fame","Tour","Vise","Serp","Bash","Mosc","Step","wolf","Leon","Guad","Tatr","Indu","Olen","Anis","Ladi","Carn","Nori","Hett","Sine","Plie","Toar","Aale","Bajo","Bath","Call","Oxfo","Kimm","Tith","Berr","Vala","Haut","Barr","Apti","Albi","Ceno","Turo","Coni","Sant","Camp","Maas","Dani","Than","Eo-l","Eo-m","Eo-u","Ol-l","Ol-u","Mi-l","Mi-m","Mi-u","Plio-l","Plio-u","Plei-l","Plei-u","R");
$datay=array("48","53","169","248","107","506","276","225","139","257","202","95","112","132","62","82","56","30","11","81","55","98","43","14","19","35","52","18","12","13","12","5","8","8","8","1","3","1","11","1","0","3","2","3","2","4","0","1","0","2","5","1","4","5","1","2","1","3","0","12","0","2","2","9","5","11","1","3","1","1","1","0","3","0","0","1","0","0","0","0");

$datay2=array("3","0","19","2","0","13","3","0","12","38","75","41","39","119","49","56","94","104","15","81","58","59","99","36","58","25","134","103","61","19","59","21","90","88","85","35","79","40","96","174","141","114","104","59","67","52","55","90","82","43","172","76","86","118","37","33","45","140","164","515","110","144","113","331","271","302","361","741","644","289","352","254","874","248","240","409","35","157","1","9");

$datay3=array("3","1","5","12","7","17","14","7","48","117","358","198","161","465","253","390","397","260","68","351","237","416","439","253","255","365","469","488","186","224","156","130","393","263","263","79","47","145","197","92","211","225","111","121","125","133","125","202","148","163","206","99","138","134","102","80","86","110","188","218","111","82","63","112","93","61","21","96","23","28","51","30","108","21","17","24","5","10","0","2");


$graph->title->Set("Sepkoski Curve/Special Graph 1 Origination");
$graph->title->SetFont(FF_FONT1,FS_BOLD);


$dplot = new LinePLot($datay);
$dplot2 = new LinePLot($datay2);
$dplot3 = new LinePLot($datay3);

$dplot->SetFillColor("blue");
$dplot2->SetFillColor("green");
$dplot3->SetFillColor("red");

$dplot->SetLegend("Cm");
$dplot2->SetLegend("Md");
$dplot3->SetLegend("Pz");


// Create the accumulated graph
$accplot = new AccLinePlot(array($dplot,$dplot3, $dplot2));

// Add the plot to the graph
$graph->Add($accplot);

//$p1 = new LinePlot($datay);
//$p1->SetFillColor("blue");
//$p1->mark->SetType(MARK_FILLEDCIRCLE);
//$p1->mark->SetFillColor("red");
//$p1->mark->SetWidth(4);
$graph->yaxis->title->SetMargin(10);

$graph->yaxis->title->Set("Number of Genera");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->SetMargin(80);
$graph->xaxis->title->Set("Stage Interval");

$graph->Stroke();
?>